package com.trsjh.db.domains;
// Generated 2012-1-13 12:55:11 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Good generated by hbm2java
 */
@Entity
@Table(name="goods"
,catalog="myglass"
, uniqueConstraints = @UniqueConstraint(columnNames="name") 
		)
public class Good  implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4016348856661525653L;
	@Id @GeneratedValue(strategy=IDENTITY)    
	@Column(name="id", unique=true, nullable=false)
	private Integer id;
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="type", nullable=false)
	private GoodsType goodsType;

	@Column(name="name", unique=true, nullable=false, length=45)
	private String name;

	@Column(name="brand", length=45)
	private String brand;


	@Column(name="price",nullable=false, precision=10, scale=2)
	private BigDecimal price;

	@Column(name="lowerPrice",nullable=false, precision=10, scale=2)
	private BigDecimal lowerPrice;

	@Column(name="description", length=45)
	private String description;

	@Column(name="photos", length=500)
	private String photos;

//	@OneToMany(fetch=FetchType.LAZY, mappedBy="goodPrice")
//	private Set<OthersOrder> othersOrders = new HashSet<OthersOrder>(0);
//
//	@OneToMany(fetch=FetchType.LAZY, mappedBy="goodsByGlass")
//	private Set<GlassOrder> glassOrdersForGlass = new HashSet<GlassOrder>(0);
//
//	@OneToMany(fetch=FetchType.LAZY, mappedBy="goodsByRightGlass")
//	private Set<GlassOrder> glassOrdersForRightGlass = new HashSet<GlassOrder>(0);
//
//	@OneToMany(fetch=FetchType.LAZY, mappedBy="goodsByLeftGlass")
//	private Set<GlassOrder> glassOrdersForLeftGlass = new HashSet<GlassOrder>(0);

	public Good() {
	}


	public Good(GoodsType goodsType, String name, BigDecimal price) {
		this.goodsType = goodsType;
		this.name = name;
		this.price = price;
	}
	public Good(GoodsType goodsType, String name, String brand, BigDecimal price, BigDecimal lowerPrice, String description, String photos) {
		this.goodsType = goodsType;
		this.name = name;
		this.brand = brand;
		this.price = price;
		this.lowerPrice = lowerPrice;
		this.description = description;
		this.photos = photos;
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public GoodsType getGoodsType() {
		return goodsType;
	}


	public void setGoodsType(GoodsType goodsType) {
		this.goodsType = goodsType;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getBrand() {
		return brand;
	}


	public void setBrand(String brand) {
		this.brand = brand;
	}



	public BigDecimal getPrice() {
		return price;
	}


	public void setPrice(BigDecimal price) {
		this.price = price;
	}


	public BigDecimal getLowerPrice() {
		return lowerPrice;
	}


	public void setLowerPrice(BigDecimal lowerPrice) {
		this.lowerPrice = lowerPrice;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public String getPhotos() {
		return photos;
	}


	public void setPhotos(String photos) {
		this.photos = photos;
	}


	@Override
	public String toString() {
		return "Good [id=" + id + ", goodsType=" + goodsType + ", name=" + name
				+ ", brand=" + brand + ", price=" + price + ", lowerPrice="
				+ lowerPrice + ", description=" + description + ", photos="
				+ photos + "]";
	}


	
	
}


